package com.yong.common.enums;

public enum Services {
	CARD("4"), SITE("10"), VIDEO("6"), AUDIO("3"), AVOID("7"), CHECKIN("8"), TICKET(
			"2"), MEMBER("11");

	private String id;

	private Services(String id) {
		this.id = id;
	}

	public String getId() {
		return this.id;
	}

	/**
	 * 返回当前枚举的小写值
	 * 
	 * @return
	 */
	public String getValue() {
		return name().toLowerCase();
	}

	/**
	 * 通过传入值获取枚举
	 * 
	 * @param value
	 * @return
	 */
	public static Services getByValue(String value) {
		if (value == null || value.equals(""))
			return null;

		Services service = null;

		try {
			service = valueOf(value.toUpperCase());
		} catch (java.lang.IllegalArgumentException e) {
		}

		return service;
	}

	/**
	 * 判断传入值是否存在相应枚举值
	 * 
	 * @param value
	 * @return
	 */
	public static boolean checkValue(String value) {
		return getByValue(value) != null;
	}
}
